//
//  SQMKAnnotationView.m
//  TQY
//
//  Created by 甘世清 on 2024/10/8.
//

#import "SQMKAnnotationView.h"

@implementation SQMKAnnotationView

- (instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        self. bgImage = [[UIImageView alloc]init];
        self.bgImage.image = SQGetImage(@"datouzhen");
        [self addSubview: self.bgImage];
        [ self.bgImage mas_makeConstraints:^(MASConstraintMaker *make){
            make.centerX.centerY.equalTo(self);
            make.size.mas_equalTo(28);
        }];
        self.addressLabel = [[UILabel alloc]init];
        self.addressLabel.textColor = UIColor.whiteColor;
        self.addressLabel.font = FONT_REGULAR(14);
        self.addressLabel.textAlignment = NSTextAlignmentCenter;
        self.addressLabel.numberOfLines = 0;
        [self addSubview:self.addressLabel];
        [self.addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
                    make.width.mas_equalTo(200);
                    make.centerX.equalTo(self);
                    make.bottom.equalTo(self.bgImage.mas_top).offset(-4);
        }];
    }
    return self;
}

@end
